import { LockOutlined, UserOutlined } from '@ant-design/icons';
import { LoginFormPage, ProFormText } from '@ant-design/pro-components';
import { history } from '@umijs/max';
import { setting } from '../../config/layout';

export default () => (
  <LoginFormPage
    title={setting.title}
    subTitle="为创作而生"
    backgroundVideoUrl="https://gw.alipayobjects.com/v/huamei_gcee1x/afts/video/jXRBRK_VAwoAAAAAAAAAAAAAK4eUAQBr"
    onFinish={async (values) => {
      console.log('values', values);
      history.replace('/');
    }}
  >
    <ProFormText
      name="phone"
      fieldProps={{
        size: 'large',
        prefix: <UserOutlined className={'prefixIcon'} />,
      }}
      placeholder={`输入账号`}
      rules={[
        {
          required: true,
          message: '请输入账号!',
        },
      ]}
    />
    <ProFormText.Password
      name="password"
      fieldProps={{
        size: 'large',
        prefix: <LockOutlined className={'prefixIcon'} />,
      }}
      placeholder={`输入密码`}
      rules={[
        {
          required: true,
          message: '请输入密码！',
        },
      ]}
    />
  </LoginFormPage>
);
